package com.mxfcode.front.bbs_business.controller;

import com.mxfcode.bbs_common.util.aes.AESUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 跳转首页
 */
@Controller
@RequestMapping("/indexController")
public class IndexController {

    private static final Logger logger= LoggerFactory.getLogger(IndexController.class);

    @GetMapping(value = "/goIndexPage")
    public String goIndexPage(){
        logger.info("==============跳转首页=============");
        return "index";
    }
    @GetMapping(value = "/goArticlePage")
    public String goArticlePage(){
        logger.info("==============跳转博客=============");
        return "article";
    }

    @PostMapping(value = "/userLogin")
    public String login(String userName,String password) throws Exception {
        System.out.println(userName);
        System.out.println(password);
        String decrypt = AESUtil.aesDecrypt(password, "MXFCODE20210125s");
        System.out.println(decrypt);
        return "bbs_email/success";
    }
}
